package com.fyzk.activity.lottery.jc.beidan;

import com.fyzk.utils.LotteryIDUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanxs11 on 2017/11/22.
 */

public class BeiDan_ZJQ_PayActivity extends BeiDanBasePayActivity {

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected BeiDanBasePayAdapter getAdapter() {
        return new BeiDan_ZJQ_PayAdapter(getContext(), pay_infors, this);
    }

    @Override
    public int getLotteryId() {
        return LotteryIDUtils.DCZJQ_LOTTERY_ID_INT;
    }

    @Override
    public String getBetCode() {
        List<String> chuans = new ArrayList<>();
        for (int i = 0; i < guoGuanTypes.size(); i++) {
            if (guoGuanTypes.get(i).isCheck) {
                chuans.add(guoGuanTypes.get(i).typeId);
            }
        }
//        if (getZhushu() > 1) {
//            wanFa = 2;
//        } else {
//            wanFa = 1;
//        }
        wanFa = 1;
        String content = "";
        for (int i = 0; i < chuans.size(); i++) {
            lotteryId = getLotteryId();
            content += lotteryId + "" + wanFa + chuans.get(i) + "-";// 301012001-
            String n = "";
            String danCodes = "";
            for (int j = 0; j < pay_infors.size(); j++) {
                BeiDanChildBean info = pay_infors.get(j);
                String danChang = "";
                if (info.checkNum != 0) {
                    danChang = info.getMatchNum() + "(";
                    if (info.isScore_0) {
                        danChang += "0,";
                    }
                    if (info.isScore_1) {
                        danChang += "1,";
                    }
                    if (info.isScore_2) {
                        danChang += "2,";
                    }
                    if (info.isScore_3) {
                        danChang += "3,";
                    }
                    if (info.isScore_4) {
                        danChang += "4,";
                    }
                    if (info.isScore_5) {
                        danChang += "5,";
                    }
                    if (info.isScore_6) {
                        danChang += "6,";
                    }
                    if (info.isScore_7) {
                        danChang += "7,";
                    }
                    danChang = danChang.substring(0, danChang.length() - 1);
                    danChang += ")";
                }
                if (!danChang.equals("")) {
                    if (info.isDan) {
                        danCodes += danChang + "|";
                    } else {
                        n += danChang + "|";
                    }
                }
            }
            if (!danCodes.equals("")) {
                danCodes = danCodes.substring(0, danCodes.length() - 1);
                danCodes += "#";
            }
            if (!n.equals("")) {
                n = n.substring(0, n.length() - 1);
                n += "^";
            }
            content += danCodes + n + "!";
        }
        if (!content.equals("")) {
            content = content.substring(0, content.length() - 1);
        }
        return content;
    }

    @Override
    protected int maxChuanCount() {
        return 6;
    }
}
